package com.mezz.bones.im.logic.startegy.impl;

import com.alibaba.fastjson.JSONObject;
import com.mezz.bones.im.common.enums.ContentTypeEnum;
import com.mezz.bones.im.common.message.content.TextContent;
import com.mezz.bones.im.logic.startegy.interfaces.IMessageContentTypeStrategy;
import org.springframework.stereotype.Service;

/**
 * @Author: zhuang
 * @Date: 2025/1/10 18:28
 * @Description: TODO
 * @Version: 1.0
 **/

@Service
public class TextContentTypeStrategyImpl implements IMessageContentTypeStrategy {
    @Override
    public String tag() {
        return ContentTypeEnum.TEXT.getType();
    }
    @Override
    public String formatContentDisplay(JSONObject jsonObject) {
        TextContent param = JSONObject.toJavaObject(jsonObject, TextContent.class);
        return param.getText();
    }
}
